<!doctype html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>List interpolation example</title>
    <script src="../../../node_modules/vue/dist/vue.global.js"></script>
    <script src="../../../packages/vue-i18n/dist/vue-i18n.global.js"></script>
  </head>
  <body>
    <div id="app">
      <form>
        <label for="locale-select">{{ t('message.language') }}</label>
        <select id="locale-select" v-model="locale">
          <option value="en">en</option>
          <option value="ja">ja</option>
        </select>
      </form>
      <p>{{ t('message.greeting', ['kazupon']) }}</p>
    </div>
    <script>
      const { createApp } = Vue
      const { createI18n, useI18n } = VueI18n

      const i18n = createI18n({
        legacy: false,
        locale: 'ja',
        messages: {
          en: {
            message: {
              language: 'Language',
              greeting: 'Hello, {0}!'
            }
          },
          ja: {
            message: {
              language: '言語',
              greeting: 'こんにちは、{0}！'
            }
          }
        }
      })

      const app = createApp({
        setup() {
          const { t, locale } = useI18n()

          // Something to do ...
          //

          return { t, locale }
        }
      })
      app.use(i18n)
      app.mount('#app')
    </script>
  </body>
</html>
